<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-06 00:34:26
 * @LastEditTime: 2020-03-17 19:57:52
 * @LastEditors: Please set LastEditors
 -->
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/vant.css">
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <script type="text/javascript" src="../script/jquery.js"></script>
    <script type="text/javascript" src="../script/layer/mobile/layer.js"></script>
    <script type="text/javascript" src="../script/vue.min.js"></script>
    <script type="text/javascript" src="../script/vant.min.js"></script>
    <script type="text/javascript" src="../script/fastclick.js"></script>
    <script type="text/javascript" src="../script/base.js"></script>
    <style type="text/css">
        .van-cell__value{
            text-align: right;
        }
        .user-img {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            overflow: hidden;
            display: inline-block;
        }

        .user-img img {
            width: 100%;
            height: 100%;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="init-full">
            <van-nav-bar class="head" title="考勤统计" left-arrow @click-left="onClickLeft">
            </van-nav-bar>
            <div class="body-no-bottom">
                <div class="content">
                    <van-cell title="出勤天数" :value="kqData.CQTS + '天'"></van-cell>
                    <van-cell title="休息天数" :value="kqData.XXTS + '天'"></van-cell>
                    <van-cell title="迟到次数" :value="kqData.CDCS + '次'"></van-cell>
                    <van-cell title="早退次数" :value="kqData.ZTCS + '次'"></van-cell>
                    <van-cell title="缺卡次数" :value="kqData.QKCS + '次'"></van-cell>
                    <van-cell title="旷工次数" :value="kqData.KGCS + '次'"></van-cell>
                    <van-cell title="外勤次数" :value="kqData.WQCS + '次'"></van-cell>
                </div>
                <van-loading v-if="showLoading" />
            </div>
        </div>
    </div>
</body>

<script type="text/javascript">
    var vm;
    apiready = function () {
        // $('.init-full').show();
        var userInfo = FLD.getUserInfo();
        vm = new Vue({
            el: '#app',
            data: {
                showLoading: false,
                userInfo: userInfo,
                kqData:''
            },
            created: function () {
                var that = this;
                that.getKQData();
            },
            methods: {
                getKQData() {
					var that = this;
					var date1 = new Date();
					date1.setDate(1);

					var date_ = new Date();
					var currentMonth = date_.getMonth();
					var nextMonth = ++currentMonth;
					var nextMonthFirstDay = new Date(date_.getFullYear(), nextMonth, 1);
					var oneDay = 1000 * 60 * 60 * 24;
					var date2 = new Date(nextMonthFirstDay - oneDay)
					var obj = {
						S_XSDate: FLD.getFormatDate(date1).split(' ')[0],
						S_XEDate: FLD.getFormatDate(date2).split(' ')[0]
					}
					FLD.ajax('APP_YHKQTJRH', obj, function (res) {
						// console.log(JSON.stringify(res))
						that.kqData = res.ds[0];
					})
				},
                onClickLeft() {
                    api.closeWin();
                }
            }
        })
    };
</script>

</html>